<?php
	require("dbfunc.php");

	$field = $_REQUEST['field'];
	$available = 1;
	$qres = mysql_query("SELECT * FROM konten WHERE judul = '$field'");
	while($row = mysql_fetch_array($qres))
	{
		if (strcmp($row['judul'],$field)==0) $available=0;
	}
	if($available==1)
	{
		echo json_encode(array('code'  =>  1,
		'result'  =>  "Judul : ".$field." belum terdapat."
		));
		die;
	}else{
		echo  json_encode(array('code'  =>  0,
		'result'  =>  "Maaf judul : '".$field."' sudah terdapat."
		));
	}
	die;
?>